package com.example.consumer.controller;


import com.example.consumer.feign.ServiceProviderFeign;
import com.example.consumer.pojo.Employee;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.List;

@RestController
public class EmployeeController {
//    @Autowired
//    private RestTemplate restTemplate;

    @Autowired
    private ServiceProviderFeign serviceProviderFeign;

    @GetMapping("/page")
    public List<Employee> page(){


        //return restTemplate.getForObject("http://localhost:8081/employee/page",List.class);


        List<Employee> employeeList = serviceProviderFeign.getEmployeeList();
        return employeeList;


    }


}
